package cn.bdqn.yemian;

import java.io.IOException;
import java.util.Scanner;

import org.dom4j.DocumentException;

import cn.bdqn.page2.BillSearch;
import cn.bdqn.page2.Change;
import cn.bdqn.page2.Delete;
import cn.bdqn.page2.Print;
import cn.bdqn.page2.TaoCanYuE;

/**
 * 登录页面下的二级页面菜单
 */
public class PageLandSecond {
	public void showInfo(String phone) {
		System.out.println("*************嗖嗖移动用户菜单**************");
		System.out
				.print("1、本月账单查询\n2、套餐余量查询\n3、打印消费详单\n4、套餐变更\n5、办理退网\n请选择（请输入1~5选择功能，其他键返回上一级）：");
		Scanner input = new Scanner(System.in);
		int choose1 = input.nextInt();
		switch (choose1) {
		case 1:
			System.out.println("ִ执行本月账单查询功能！");
			BillSearch bs = new BillSearch();
			try {
				bs.billSearch(phone);
			} catch (DocumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			break;
		case 2:
			System.out.println("执行套餐余量查询功能！");
			TaoCanYuE tc = new TaoCanYuE();
			try {
				tc.yuE(phone);
			} catch (DocumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			break;
		case 3:
			System.out.println("执行打印消费详单功能！");
			Print pr = new Print();
			try {
				pr.printDoc(phone);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (DocumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			break;
		case 4:
			System.out.println("执行套餐变更功能！");
			Change ch = new Change();
			try {
				ch.change(phone);
			} catch (DocumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			break;
		case 5:
			System.out.println("ִ执行办理退网功能！");
			Delete de = new Delete();
			try {
				de.delete(phone);
			} catch (DocumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			break;
		default:
			System.out.println("选择错误，执行返回上一级！");
			PageStart ps = new PageStart();
			ps.showInfo();
			break;
		}
	}
}
